#pragma once

#include "KClassFactory.h"

class CKDynamicClass
{
public:
	CKDynamicClass(string name, createClass method)
	{
		CKClassFactory::sharedClassFactory().registClass(name, method);
		delete this;
	}

	virtual ~CKDynamicClass()
	{

	}
};

#define DECLARE_CLASS(className) \
	static CKDynamicClass* m_##className##dc;

#define IMPLEMENT_CLASS(className) \
	CKDynamicClass* className::m_##className##dc = \
	new CKDynamicClass(#className, className::createInstance);